<template>
  <div class="detail-wrap">
    <!--    <title-bar />-->
    <div style="display: flex; width: 100%">
      <div style="height: 70mm; width: 660px">
        <div style="display: flex; flex-direction: column; align-items: flex-start">
          <div class="title">新疆远届马铃薯产业有限公司原料收购单</div>
          <div class="info" style="margin-bottom: 6px">
            <span>时间: {{ dayjs().format("YYYY-MM-DD HH:mm:ss") }}</span>
            <span style="margin-left: 280px; text-align: left; min-width: 150px">No: {{ printData.no }}</span>
          </div>
          <div>
            <table style="width: 660px">
              <tr>
                <td width="40">车号</td>
                <td width="80" style="text-align: right">{{ printData.plateNo }}</td>
                <td width="60">发货单位</td>
                <td width="80" style="text-align: right">{{ printData.supplier }}</td>
                <td width="70">规格型号</td>
                <td width="150" style="text-align: right">{{ printData.spec }}</td>
              </tr>
              <tr>
                <td>毛重</td>
                <td style="text-align: right">{{ printData.weightTotal }} 公斤</td>
                <td>扣率</td>
                <td style="text-align: right">{{ printData.weightReduceRate }} %</td>
                <td>卸车单价</td>
                <td style="text-align: right">{{ printData.unloadUnitPrice }} 元</td>
              </tr>
              <tr>
                <td>皮重</td>
                <td style="text-align: right">{{ printData.weightTare }} 公斤</td>
                <td>实际净重</td>
                <td style="text-align: right">{{ printData.weightReal2 }} 公斤</td>
                <td>卸车费</td>
                <td style="text-align: right">{{ printData.unloadFee }} 元</td>
              </tr>
              <tr>
                <td>净重</td>
                <td style="text-align: right">{{ printData.weightNet }} 公斤</td>
                <td>货物单价</td>
                <td style="text-align: right">{{ printData.priceUnit }} 元</td>
                <td>结算金额</td>
                <td style="text-align: right">{{ printData.settlementFee }} 元</td>
              </tr>
              <tr>
                <td>扣杂</td>
                <td style="text-align: right">{{ printData.weightReduce }} 公斤</td>
                <td>货物金额</td>
                <td style="text-align: right">{{ printData.priceTotal }} 元</td>
                <td>金额大写</td>
                <td style="text-align: right">{{ printData.settlementFeeZh }}</td>
              </tr>
            </table>
          </div>

          <div class="footer">
            <div class="sign">
              <span class="txt-width" style="min-width: 250px">毛重时间: {{ printData.timeIn }}</span>
              <span class="txt-width" style="min-width: 250px; margin-left: 160px"
                >皮重时间: {{ printData.timeOut }}</span
              >
            </div>
            <div class="sign">
              <span class="txt-width">司磅员: {{ printData.creator }}</span>
              <span class="txt-width" style="margin: 0 74px">收料员: </span>
              <span>付款员: </span>
            </div>
          </div>
        </div>
      </div>
      <div style="height: 70mm; width: 100px">
        <div>+</div>
        <div style="margin: 60px 0">+</div>
        <div style="margin: 60px 0">+</div>
        <div>+</div>
      </div>
      <div style="height: 70mm; width: 230px">
        <div style="display: flex; flex-direction: column; align-items: flex-start">
          <div class="title" style="margin-left: 20px; font-size: 22px">新疆远届称重磅单</div>
          <div class="sign" style="margin-bottom: 6px; font-size: 17px">
            <span>时间: {{ dayjs().format("YYYY-MM-DD HH:mm:ss") }}</span>
          </div>
          <div>
            <table style="width: 100%; font-size: 16px">
              <tr>
                <td width="80">流水号</td>
                <td width="110" style="text-align: right">{{ printData.no }}</td>
              </tr>
              <tr>
                <td>发货单位</td>
                <td>{{ printData.supplier }}</td>
              </tr>
              <tr>
                <td>车号</td>
                <td>{{ printData.plateNo }}</td>
              </tr>
              <tr>
                <td>毛重</td>
                <td style="text-align: right">{{ printData.weightTotal }} 公斤</td>
              </tr>
              <tr>
                <td>皮重</td>
                <td style="text-align: right">{{ printData.weightTare }} 公斤</td>
              </tr>
              <tr>
                <td>净重</td>
                <td style="text-align: right">{{ printData.weightNet }} 公斤</td>
              </tr>
              <tr>
                <td>司磅员</td>
                <td>{{ printData.creator }}</td>
              </tr>
            </table>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script lang="ts" setup>
import { onMounted, reactive } from "vue"
import IpcDict from "@/constants/ipc-dict"
import dayjs from "dayjs"

const props = defineProps({
  printType: {
    type: String,
    default: ""
  },
  data: {
    type: Object,
    default: {}
  }
})

const printData = reactive(props.data)
</script>

<style lang="scss" scoped>
.detail-wrap {
  font-size: 16px;
  .title {
    font-size: 27px;
    /*font-weight: bold;*/
    margin-bottom: 10px;
    margin-left: 80px;
  }
  .info {
    text-align: left;
    margin: 5px 0;
    font-size: 17px;
  }
  table {
    /*width: 190mm;*/
    width: auto;
    border-collapse: collapse;
  }
  td,
  th {
    border: 1px solid #000;
    padding: 4px 6px;
    text-align: center;
  }
  .footer {
    margin-top: 10px;
    font-size: 17px;
    text-align: left;
  }
  .sign {
    margin-top: 5px;
    /*display: flex;*/
    /*justify-content: space-between;*/
  }
  .txt-width {
    display: inline-block;
    min-width: 140px;
  }
}
</style>
